package LeetCode;

public class LC_453_MinimumMovestoEqualArrayElements {

    public static void main(String[] args) {

    }

    class Solution {
        public int minMoves(int[] nums) {
            if (nums.length == 0) return 0;
            int min = nums[0];
            int sum = 0;
            for (int n : nums) {
                min = Math.min(min, n);
                sum += n;
            }
            return sum - nums.length * min;
        }

    }
}